package dome3;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description: 包装类作业题
 * User: 王圆豪
 * Date: 2024-07-16
 * Time: 21:59
 */
public class Test {
    public static int remove(int[] nums){
        int count = 0;
        int k = 1;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] == nums[i - 1]) {
                count++;
            }else {
                nums[i - count] = nums[i];
                k++;
            }
        }
        return k;
    }

    public void merge(int[] nums1, int m, int[] nums2, int n) {
        int size = 0;
        for (int i = nums1.length - nums2.length; i < nums1.length; i++) {
            nums1[i] = nums2[size++];
        }
        Arrays.sort(nums1);
    }

    public static void main1(String[] args) {

    }
}
